package org.jeecg.modules.weixi.service.impl;


import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.modules.weixi.entity.wxUser;
import org.jeecg.modules.weixi.mapper.wxUserMapper;
import org.jeecg.modules.weixi.service.wxUserService;
import org.jeecg.modules.weixi.util.EmptyUtil;
import org.jeecg.modules.weixi.util.HttpUtil;
import org.jeecg.modules.weixi.util.WxEnumUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

/**
 * 类名称：UserServiceImpl
 * 类描述：
 * 创建人：黄丽娟
 * @date 2021-08-18 16:44
 */
@Service
public class  WxUserServiceImpl extends ServiceImpl<wxUserMapper, wxUser> implements wxUserService {
    @Resource
    private wxUserMapper wxUserMapper;

    @Override
    public wxUser findByUser(wxUser user) {
        QueryWrapper<wxUser> queryWrapper = new QueryWrapper<wxUser>();
        queryWrapper.eq("realname",user.getRealname());
        queryWrapper.eq("password",user.getPassword());
        return wxUserMapper.selectOne(queryWrapper);
    }

    @Override
    public wxUser findOpenId(String openId) {
        QueryWrapper<wxUser> queryWrapper = new QueryWrapper<wxUser>();
        queryWrapper.eq("open_id",openId);
        return wxUserMapper.selectOne(queryWrapper);
    }
}
